import { useNavigate } from "react-router-dom";

import Micons from "@/components/MIcons/index";

import "./index.scss";

const PageTitle = (props: any) => {

    const navigate = useNavigate();

    /**
     * 返回上一页
     */
    function handleGoBack() {
      navigate(-1); // 或者使用 history.go(-1)
    }

  const { title = "title" } = props;
  return (
    <div className="page-title-box">
      <div className="left-box" onClick={handleGoBack}>
        <span className="icon-box">
          <Micons type="extend" className="icon-gengduo" colorFill="#ffffff" />
        </span>
        <span className="name">Return Back</span>
      </div>
      <div className="title">{title}</div>
    </div>
  );
};

export default PageTitle;
